<script>
var arr = [{ label: '男', value: 1 }, { label: '女', value: 0 }]

function f(arr) {
  // 写代码，得到
  const newArr = []
  for (const key in arr) {
    newArr.push(arr[key].label)
  }
  return newArr
}
var arr2 = f(arr)
console.log(arr2)
// arr2 = ['男', '女']
</script>
